import {req} from './config.js'
export function postinsert(lmoduleno,lusercode,data) {
	return req.ajax({
		path: '/insert',
		title : '加载中...',
		method: 'POST',
		dataType: 'json',
		header: {
		    'content-type': 'application/json;charset=UTF-8',
			'token':uni.getStorageSync('token')
		},
		data: {
		    lmoduleno,
		    lusercode,
		    data
		},
	})
}
// 添加员工和人脸接口
export function postaddStaff(staff,faceInfo) {
	return req.ajax({
		path: '/addStaff',
		title : '加载中...',
		method: 'POST',
		dataType: 'json',
		header: {
		    'content-type': 'application/json;charset=UTF-8',
			'token':uni.getStorageSync('token')
		},
		data: {
		    staff,
		    faceInfo
		},
	})
}

export function postinsertbq(lusercode,lmakeopid,lremark,latedate,latetype,lmakeopdate,lphoto) {
	return req.ajax({
		path: '/insertbq',
		// title : '加载中...',
		method: 'POST',
		dataType: 'json',
		header: {
		    'content-type': 'application/x-www-form-urlencoded',
			'token':uni.getStorageSync('token')
		},
		data: {
		    lusercode,
		    lmakeopid,
		    lremark,
			latedate,
			latetype,
			lmakeopdate,
			lphoto
		},
	})
}

export function addForm(lcode,lname,lisused,lremark,luid,lissystem) {
	return req.ajax({
		path: '/addForm',
		// title : '加载中...',
		method: 'POST',
		dataType: 'json',
		header: {
		    'content-type': 'application/x-www-form-urlencoded',
			'token':uni.getStorageSync('token')
		},
		data: {
		    lcode,
		    lname,
		    lisused,
			lremark,
			luid,
			lissystem
		},
	})
}

export function generateExcel(className,data) {
	return req.ajax({
		path: '/generateExcel',
		// title : '加载中...',
		method: 'POST',
		dataType: 'json',
		header: {
		    'content-type': 'application/json',
			'token':uni.getStorageSync('token')
		},
		data: {
		    className,
			data
		},
	})
}
